package com.nbsaas.boot.finance.data.entity;

import com.nbsaas.boot.code.annotation.*;
import com.nbsaas.boot.jpa.data.entity.AbstractEntity;
import jakarta.persistence.Column;
import jakarta.persistence.Entity;
import jakarta.persistence.Table;
import lombok.Data;
import org.hibernate.annotations.Comment;

import java.math.BigDecimal;
import java.util.Date;

@CreateByUser
@ComposeView
@Data
@FormAnnotation(title = "发票", model = "发票")
@Entity
@Table(name = "bs_invoice")
@Comment("发票表")
public class Invoice extends AbstractEntity {

    @Comment("发票号")
    @FormField(title = "发票号", sortNum = "1", grid = true, required = true)
    @Column(length = 50, nullable = false, unique = true)
    private String invoiceNo;

    @Comment("客户ID")
    @FormField(title = "客户ID", sortNum = "2", grid = true)
    private Long customerId;

    @Comment("金额")
    @FormField(title = "金额", sortNum = "3", grid = true, type = InputType.el_input_number)
    private BigDecimal amount;

    @Comment("状态")
    @FormField(title = "状态", sortNum = "4", grid = true, type = InputType.select)
    @Column(length = 20)
    private String status;

    @Comment("申请日期")
    @FormField(title = "申请日期", sortNum = "5", type = InputType.date, grid = true)
    private Date applyDate;

    @Comment("开票日期")
    @FormField(title = "开票日期", sortNum = "6", type = InputType.date, grid = true)
    private Date issueDate;

    @Comment("备注")
    @FormField(title = "备注", sortNum = "7", type = InputType.textarea)
    private String remark;
} 